<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
<title>教务管理系统</title>
<meta charset="UTF-8">
<base th:href="@{/}"/>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"/>
<script th:src="@{/js/jquery-3.4.1.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<style type="text/css">
	body{
		background:#f3f3f3;
		overflow: hidden; 
	}
	a{
		color: black;
		text-decoration: none;
		display:block;
	}
	a:hover {
	 	color: white;
	 	text-decoration: none;
	}
	a:focus{
		color: #b63b4d;
	 	text-decoration: none;
	}
	ul {
		list-style-type: none;
	}
	
	.main-container{
		overflow: hidden;
		height: 650px;
	}
	.main-container iframe{
		position:fixed;
		border:0;
		width: 85%;
		height: 650px;
	}
	.sidebar{
		width: 15%;
	 	background: #FFF;
	 	border-radius: 4px;
	 	float: left;
	 	height: 680px;
	}
	
	.header{
		height: 90px;
		background: #3c417a;
		color: white;
	}
	.sidebar-list {
		padding:0px;
	}
	
	.sidebar-list .link{
		display: block;
		color: #4D4D4D;
		font-size: 14px;
		font-weight: 700;
		position: relative;
		transition: all 0.4s ease;
	}
	.sidebar-list .link a{
		display: block;
		padding: 15px 15px 15px 75px;;
	}
	.sidebar-list li i {
		padding-left:30px;
		position: absolute;
		top: 16px;
		left: 12px;
		font-size: 18px;
		color: #595959;
	}
	.sidebar-list .link:hover{
		background-color: #212657;
		color: white;
	}
	.login{
		padding:35px;
		float: right;
		font-size: 18px;
	}
	.logout{
		padding:35px;
		float: right;
		font-size: 18px;
	}
</style>
</head>
<body>
	<div class="header">
		<div class="login" sec:authorize="isAnonymous()">
        	<span>您还未登录，请</span><a th:href="@{/login}" style="display: inline; ">登录</a>
        </div>
        
        <div sec:authorize="isAuthenticated()">
        	<div class="logout">
	        	<span>当前学期：<span th:text="${session.currentTerm.term.termName}"></span><span>，欢迎登录，</span><span th:text="${#authentication.name}==1?'管理员':${#authentication.name}"></span>
				<form th:action="@{/logout}" method="POST" style="display: inline;">
					<button class="btn btn-danger btn-sm fixed-right">退出登录</button>
				</form>
			</div>
        </div>
	</div>
	<div class="main">
		<div class="sidebar">
			<div sec:authorize="isAuthenticated()">
	            <div sec:authorize="hasRole('student')">
		            <ul class="sidebar-list">
		                <li>
							<div class="link"><i class="fa fa-globe"></i><a th:href="@{/User/UserInfo}" target="frame">用户信息</a></div>
						</li>
		                <li>
							<div class="link"><i class="fa fa-globe"></i><a th:href="|stu/CheckLessionPlan?mjid=${session.loginStudent.batch.major.mjid}&tyear=${session.loginStudent.batch.major.term.tyear}|" target="frame">查看个人教学计划</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a th:href="|stu/evaluateTeacher?mjid=${session.loginStudent.batch.major.mjid}&bid=${session.loginStudent.batch.bid}&termId=${session.currentTerm.term.termId}&srollno=${#authentication.name}|" target="frame">评教</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="stu/toQueryGrade" target="frame">成绩查询</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="stu/toSchedule" target="frame">查看课表</a></div>
						</li>
		            </ul>
	            </div>
	            <div sec:authorize="hasRole('teacher')">
		            <ul class="sidebar-list">
		                <li>
							<div class="link"><i class="fa fa-globe"></i><a href="teach/User/UserInfo" target="frame">用户信息</a></div>
						</li>
		                <li>
							<div class="link"><i class="fa fa-globe"></i><a href="teach/selectCoursePlan" target="frame">查询开课计划</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="teach/toGetAssessResult" target="frame">查询评教结果</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="teach/toSchedule" target="frame">查看课表</a></div>
						</li>
		            </ul>
	            </div>
				<div sec:authorize="hasRole('admin')">
					<ul class="sidebar-list" >
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllAcadamy" target="frame">学院管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllMajor" target="frame">专业管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllBatch?" target="frame">班级管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllTeacher" target="frame">教师管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllCourse?keyword=" target="frame">课程管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/toInsertLessionPlan" target="frame">专业教学计划管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllStructure" target="frame">排课</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllStudent?keyword=" target="frame">学生管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllBuilding" target="frame">教学楼管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllClass" target="frame">教室管理</a></div>
						</li>
						<li>
							<div class="link"><i class="fa fa-globe"></i><a href="mc/getAllTerm" target="frame">学期管理</a></div>
						</li>
					</ul>
				</div>
			</div>
		</div>
		
		<div class="main-container">
			<iframe name="frame">
			</iframe>
		</div>
	</div>
</body>
</html>